
<div xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" th:fragment="topv2">
   <!-- 导航 -->
    <nav class="blog-nav layui-header">
        <div class="blog-container">
            <!-- QQ互联登陆 -->
            <a class="blog-user" th:if="${session.user==null}" href="/login" style="color: #c2c2c2;">
                  <i class="fa fa-desktop"></i>登录
            </a>
            <a th:unless="${session.user==null}" class="blog-user "  href="/loginOut" style="color: #c2c2c2;">
            <i class="fa fa-power-off fa-fw"></i>退出登录</a>
            <!-- 导航菜单 -->
            <ul class="layui-nav" lay-filter="nav">
                <li class="layui-nav-item">
                    <a href="/"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
                </li>
                <li th:unless="${session.user==null}" class="layui-nav-item ">
                    <a  th:href="@{/article/list(user=${session.user.id})}"><i class="fa fa-file-text fa-fw"></i>&nbsp;文章专栏</a>
                </li>
                <!--<li class="layui-nav-item">-->
                    <!--<a href="timeline.html"><i class="fa fa-hourglass-half fa-fw"></i>&nbsp;点点滴滴</a>-->
                <!--</li>-->
                <!--<li class="layui-nav-item">-->
                    <!--<a href="about.html"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>-->
                <!--</li>-->
                <li th:unless="${session.user==null}" class="layui-nav-item">
                    <a  href="/article/add"><i class="fa fa-pencil fa-fw"></i>&nbsp;写文章</a>
                </li>
                <li  class="layui-nav-item">
                    <a href="/admin"  th:unless="${session.user==null}"  shiro:hasRole="admin"><i class="fa fa-cogs fa-fw"></i>&nbsp;后台管理</a>
                </li>
            </ul>
            <!-- 手机和平板的导航开关 -->
            <a class="blog-navicon" href="javascript:;">
                <i class="fa fa-navicon"></i>
            </a>
        </div>
    </nav>
</div>